package cn.com.dhcc.ddi.stat.vo.wrapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import cn.com.dhcc.app.core.handler.dbhandler.WappedResultSet;
import cn.com.dhcc.ddi.stat.vo.TaskSyncStatVo;

public class TaskSyncStatRowWrapper implements RowMapper<TaskSyncStatVo>{

	@Override
	public TaskSyncStatVo mapRow(ResultSet rss, int rowNum) throws SQLException {
		WappedResultSet rs = new WappedResultSet(rss);
		TaskSyncStatVo vo = new TaskSyncStatVo();
		vo.setID(rs.getString("id"));
		vo.setTaskId(rs.getString("task_id"));
		vo.setCataId(rs.getString("cata_id"));
		if(rs.getInteger("data_size") != null){
			vo.setDataSize(rs.getInteger("data_size"));
		}
		if(rs.getInteger("total") != null){
			vo.setTotal(rs.getInteger("total"));
		}
		vo.setStatDate(rs.getTimestamp("stat_date"));
		vo.setMtime(rs.getTimestamp("mtime"));
		vo.setSum(rs.getString("sum"));
		vo.setNum(rs.getString("num"));
		vo.setTaskName(rs.getString("task_name"));
		vo.setStatisticsCount(rs.getString("statistics_count"));
		vo.setStatisticsDataSize(rs.getString("statistics_data_size"));
		vo.setNodeName(rs.getString("node_name"));
		vo.setDataCataName(rs.getString("cata_name"));
		vo.setNodeId(rs.getString("node_id"));
		return vo;
	}

}
